<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<div class="container-fluid">
  <label class="stepDesc">Please enter the required information for the measure!</label>
  <div class="container-fluid">
    <div class="col-md-12 col-lg-12 col-sm-12">
      <fieldset>
        <legend>
          Required Information
        </legend>
        <div class="y-scrollable">
          <div class="col-md-12 col-lg-12 col-sm-12" style="margin-top:55px;">
            <div class="form-group" [ngClass]="{'has-error':prName.dirty&&prName.invalid, 'has-success':prName.valid}">
              <label class="col-md-2 col-lg-2 col-sm-2 control-label">
                Measure Name<span class="symbol required"></span>:
              </label>
              <div class="col-md-10 col-lg-10 col-sm-10 ">
                <input type="text" class="form-control" [(ngModel)]="step4.prName" #prName="ngModel"
                       placeholder="Please input the measure name" required pattern="^[a-zA-Z0-9_-]*$">
                <span class="error text-small block " *ngIf="prName.dirty && (prName.errors?.required)">Measure Name is required</span>
                <span class="error text-small block " *ngIf="prName.dirty && (prName.errors?.pattern)">Only letter, number, "-" and "_" are allowed</span>
              </div>
            </div>
          </div>
          <div class="col-md-12 col-lg-12 col-sm-12" style="margin-top:10px;">
            <div class="form-group">
              <label class="col-md-2 col-lg-2 col-sm-2 control-label">
                Measure Description:
              </label>
              <div class="col-md-10 col-lg-10 col-sm-10">
                <input type="text" class="form-control" [(ngModel)]="step4.desc"
                       placeholder="Please input detailed description of your measure" name="desc">
              </div>
            </div>
          </div>
          <div class="col-md-12 col-lg-12 col-sm-12" style="margin-top:10px;">
            <div class="form-group">
              <label for="typeSelector" class="col-md-2 col-lg-2 col-sm-2 control-label">
                Measure Type:
              </label>
              <div class="col-md-10 col-lg-10 col-sm-10">
                <select id="typeSelector" class="form-control" [(ngModel)]="step4.type" disabled required name="type">
                  <option>{{step4.type}}</option>
                </select>
              </div>
            </div>
          </div>
          <div class="col-md-12 col-lg-12 col-sm-12" style="margin-top:10px;">
            <div class="form-group">
              <label class="col-md-2 col-lg-2 col-sm-2 control-label">
                DataSource:
              </label>
              <div class="col-md-10 col-lg-10 col-sm-10">
                <input type="text" class="form-control" name="DataAsset" value="{{step1.currentTable}}" disabled>
              </div>
            </div>
          </div>
          <div class="col-md-12 col-lg-12 col-sm-12" style="margin-top:10px;">
            <div class="form-group">
              <label class="col-md-2 col-lg-2 col-sm-2 control-label">
                Owner:
              </label>
              <div class="col-md-10 col-lg-10 col-sm-10">
                <input type="text" class="form-control" name="owner" disabled [(ngModel)]="step4.owner">
              </div>
            </div>
          </div>
        </div>
        <div style="color:#b2c831">
          <p>
            <i class="fa fa-info-circle"></i> After submitted, please go to "<a class="bark-link"
                                                                                routerLink="/measures">Measures</a>" to
            check the measure status
          </p>
        </div>
      </fieldset>
    </div>
    <div class="form-group btn-container">
      <button class="btn btn-primary btn-o back-step btn-wide pull-left" (click)="prevChildStep()">
        <i class="fa fa-arrow-circle-left"></i> Back
      </button>
      <toaster-container></toaster-container>
      <button type="submit" (click)="submit()" class="btn btn-primary btn-o next-step btn-wide pull-right">
        Submit
      </button>
    </div>
  </div>
</div>



